package com.sunday.minio.entity;

import com.sunday.minio.utils.MinioUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 基础响应
 *
 * @author zsy
 * @since 2023/10/16
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BaseResult {

    /**
     * 桶名称
     */
    private String bucket;

    /**
     * 文件名称(需要唯一,否则会覆盖)
     */
    private String object;

    public static BaseResult of(String bucket, String object) {
        return new BaseResult(bucket, object);
    }

    public String format() {
        return MinioUtils.format(this);
    }

}
